#ifndef IO_H_
#define IO_H_

#include "process.h"
#include "pthread.h"

struct CPUStr;
typedef struct CPUStr* CPU_IO;

enum DeviceType {
    IO,
    KEYBOARD
} DeviceType;

typedef struct {
	enum DeviceType type;
	void (*function_ptr)();
	CPU_IO cpu;
	pthread_t thread;
} IOStr;

#define MAX_WAIT 20000

typedef IOStr * IODevice;

IODevice initializeIODevice(void *, enum DeviceType, CPU_IO cpu);
void startIODevice(IODevice);

#endif /* IO_H_ */
